<template>
  <div class="personal-info">
	<PageContainer
    title="个人信息" back no-tab>
		<div class="info">
      <u-cell-group :border="false">
        <u-cell title="头像" value="">
          <template #value>
            <u-image :showLoading="true" :src="user.url || ''" width="44" height="44"></u-image>
          </template>
        </u-cell>
        <u-cell title="昵称" :value="user.nickName"></u-cell>
        <u-cell title="手机号码" :value="user.phone"></u-cell>
        <u-cell title="我的邀请码" value="xixiauxiawuu" @click="copyText('xixiauxiawuu')"></u-cell>
      </u-cell-group>
    </div>
	</PageContainer>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import PageContainer from '@/components/PageContainer/index.vue'
import { getStorageUserInfo } from '@/hooks/useLogin'
import { useToast } from '@/hooks/useToast'

const user = getStorageUserInfo()
const toast = useToast()



const copyText = (value: any) => {
  uni.setClipboardData({
    data:value,
    success:function(){
      console.log('success',value)
      toast.success('复制成功')
    }
  })
}

</script>

<style lang="less" scoped>
.personal-info {
	.info {
    padding: 16px;
  }
}
</style>
